
package proxy.dynamic;

import common.HelloException;
import common.HelloInterface;
import common.HelloSpeaker;

/**
 * @author Eric.Kao(gau168.gau@msa.hinet.net)
 * @version 1.0
 * @company E885 Group
 * @copyright Copyright (c) 2001-2008
 */

public class DynamicProxyTester
{
	public DynamicProxyTester() throws HelloException
	{
		HelloProxy proxy = new HelloProxy();

		// 傳入一個被代理物件, 並建立代理物件傳回來
		HelloInterface hello = ( HelloInterface )proxy.bind( new HelloSpeaker() );

		hello.sayHello( "eric.kao" );
	}

	public static void main( String[] args )
	{
		try
		{
			new DynamicProxyTester();
		}
		catch( HelloException e )
		{
			e.printStackTrace();
		}
	}

}
